from flask import Blueprint, render_template, request
import threading
from model.dsModels import dsModels
from include.task import *

phcrontab = Blueprint('phcrontab', __name__, template_folder='templates')


@phcrontab.route('/')
def index():
    my = dsModels()
    list = my.get_list()
    print(list)
    return render_template('phcrontab/index.html', list=list)


@phcrontab.route('/to/', methods=['POST'])
def to():
    fun = int(request.form['fun'])
    t1 = threading.Thread(target=run, args=(fun,))
    t1.start()
    return '成功'
